package pms.customer;

import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

import pms.contract.service.GenericGenerator;
import pms.customer.admin.domain.Customer;

public class CustomerEntityGenerator extends GenericGenerator {

	@Autowired
	CustomerManager customerManager;

	@Test
	public void gen_customer() 
	{
		for (int i = 0; i < 10; i++) 
		{
			Customer customer = new Customer();
			customer.setCustomerNAME("customer_" + i);
			this.customerManager.save(customer);
			for (int j = 0; j < 10; j++) 
			{
				Customer c = new Customer();
				c.setCustomerNAME("customer_" + i + "_" + j);
				c.setCustomerPHONE1("customerPHONE1_"+ i + "_" + j);
				c.setCustomerPHONE2("customerPHONE2_"+ i + "_" + j);
				c.setCustomerHOME("customerHOME_"+ i + "_" + j);
				customer = this.customerManager.save(c);
				this.customerManager.save(customer);
			}
		}
	}
}